package com.gzucm.Scholarship.common.enums;

import com.gzucm.Scholarship.exception.SwitchNotFoundException;

public enum ScoreType {
    WT,
    DY,
    ZY;

    public static ScoreType get(Integer code) {
        switch (code) {
            case 1:
                return DY;
            case 2:
                return ZY;
            case 3:
                return WT;
        }
        throw new SwitchNotFoundException(ScoreType.class, "找不到code为：" + code + " 的ScoreType");
    }

    public Integer getCode() {
        switch (this) {
            case DY:
                return 1;
            case ZY:
                return 2;
            case WT:
                return 3;
        }
        throw new SwitchNotFoundException(ScoreType.class);
    }
}
